<!doctype html>
<html lang="en">
	<head>
		<meta charset="UTF-8">
		<meta name="Generator" content="EditPlus®">
		<meta name="Author" content="">
		<meta name="Keywords" content="">
		<meta name="Description" content="">
		<title>九九乘法表</title>
		<style type="text/css">
			table td{border:1px solid #ccc;padding:5px;}
			table td:hover{background:#141414;color:#fff;}
		</style>
			
	</head>
	<body>
	<h1>九九乘法表</h1>
	<input type="text" id="number"/><input type="button" onclick="tm_change(this)"
	value="更换"/>
	<hr>
	
		<div id="tm_box"></div>
		<script type="text/javascript">
		tm_cfb(9);
		function tm_cfb(number){
			var html = "<table>";
			for(var i=1;i<=number;i++){
				html +="<tr>";
				for(var j=1;j<=i;j++){
				html +="<td>"+j+"*"+i+" = "+(i*j)+"</td>";
				}
				html+="</tr>";
			}
			html+="</table>";
			document.getElementById("tm_box").innerHTML = html;
		}

		function tm_change(obj){
			var number = document.getElementById("number").value;
			if(number==""||number<1)return;
			tm_cfb(number);
		}
		</script>
	</body>
</html>